// 2025/4/3
// https://leetcode.cn/problems/single-number/description/?envType=study-plan-v2&envId=top-100-liked
// 只出现一次的数字

class Solution {
    public:
        int singleNumber(vector<int>& nums) {
            int n = nums.size(), ans = nums[0];
            for(int i = 1; i < n; i++)
            {
                ans ^= nums[i];
            }
            return ans;
        }
    };